import request from '../utils/request';

export async function getOrderList() {
  return request('/wyApi/api/order');
}

export async function getOrderDetail(id) {
  return request(`/wyApi/api/order/${id}`);
}

export async function getByNumber(orderNumber) {
  return request(`/wyApi/api/order/by-number/${orderNumber}`);

}

export async function deleteOrder(id) {
  return request(`/wyApi/api/order/${id}`, {method: 'DELETE'});
}

export async function cancelOrder(id) {
  return request(`/wyApi/api/order/${id}/cancel`, {method: 'POST'});
}